<?php
/**
 * @copyright Copyright (C) 2010 redCOMPONENT.com. All rights reserved.
 * @license GNU/GPL, see license.txt or http://www.gnu.org/copyleft/gpl.html
 * Developed by email@recomponent.com - redCOMPONENT.com
 *
 * redSHOP can be downloaded from www.redcomponent.com
 * redSHOP is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License 2
 * as published by the Free Software Foundation.
 *
 * You should have received a copy of the GNU General Public License
 * along with redSHOP; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
jimport('joomla.plugin.plugin');

class plgRedshop_paymentrs_payment_banktransfer extends JPlugin
{
	var $_table_prefix = null;
   /**
    * Constructor$mainframe =& JFactory::getApplication();
 		$paymentpath=JPATH_SITE.DS.'plugins'.DS.'redshop_payment'.DS.$plugin.DS.'extra_info.php';
		include($paymentpath);
    *
    * For php4 compatability we must not use the __constructor as a constructor for
    * plugins because func_get_args ( void ) returns a copy of all passed arguments
    * NOT references.  This causes problems with cross-referencing necessary for the
    * observer design pattern.
    */
   	function plgRedshop_paymentrs_payment_banktransfer(&$subject)
    {
        // load plugin parameters
        parent::__construct( $subject );
        $this->_table_prefix = '#__redshop_';
        JPluginHelper::getPlugin( 'redshop_payment', 'onPrePayment' );
		$this->_plugin = JPluginHelper::getPlugin( 'redshop_payment', 'rs_payment_banktransfer' );
		$this->_params = new JRegistry( $this->_plugin->params );
    }

    /**
    * Plugin method with the same name as the event will be called automatically.
    */
 	function onPrePayment($element, $data)
    {
		$tag = JFactory::getLanguage()->getTag();
    	if($element!='rs_payment_banktransfer'){
    		return;
    	}
    	if (empty($plugin))
        {
         	$plugin = $element;
        }
        return true;
    }
}
